package com.du.managerback.controller;

import com.du.managerback.service.EmployeeService;
import com.du.managerback.utils.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
public class Hello {




    @Autowired
    EmployeeService employeeService;

    @GetMapping("/hello")
    public BaseResult hello() {
        return BaseResult.success("服务器数据");
    }


    @GetMapping("/age")
    public BaseResult getAge() {

        return BaseResult.success(18);
    }

    @GetMapping("/map")
    public BaseResult getInfo() {
        HashMap<String, String> map = new HashMap<>();
        map.put("username", "jie");
        map.put("passWord", "admin");
        map.put("age", "20");
        return BaseResult.success(map);
    }

    @GetMapping("/getAll")
    public BaseResult getAll() {
        employeeService.setAll();
        return null;
    }

}
